@import './variable.scss'; // css变量
@import './btn.scss'; // css变量
@import './mui-extend.scss'; // css变量
@import './layer-extend.scss'; // css变量
@import './step-extend.scss'; // css变量

body,
html {
  margin: 0;
  padding: 0;
  padding-bottom: .4rem;
  // width: 100%;
  // height: 100%;
  font: .2rem 'PingFang-SC-Medium', 'Microsoft YaHei', 'Helvetica Neue', 'Helvetica, Arial', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: left;
  color: $mainFontColor;
  background-color: #f7f7f7;
}

p,
ul,
ol,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  padding: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: bold;
  text-align: left;
}

b,
strong,
i,
span {
  vertical-align: middle;
}

ul,
ol {
  list-style: none;
}

label,
input,
select,
textarea {
  margin: 0;
  padding: 0;
  font-size: .28rem;
  vertical-align: middle;
}

a {
  color: $mainColor;
  vertical-align: middle;
  text-decoration: none;
}

/* 设置滚动条宽度 */
::-webkit-scrollbar {
  width: 0px;
}

::-webkit-scrollbar {
  display: none;
}

::-webkit-input-placeholder {
  color: #BDBDBD;
}

input {
  appearance: none;
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  border-radius: 0;
  -moz-border-radius: 0px;
  -webkit-border-radius: 0px;
}

@media only handheld {
  input {
    -webkit-appearance: none;
    appearance: none;
    outline: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    border-radius: 0;
    -moz-border-radius: 0px;
    -webkit-border-radius: 0px;
  }
}


::-webkit-input-placeholder {
  /* WebKit, Blink, Edge */
  color: #cbcbcb;
  font-family: PingFang-SC-Medium, "Microsoft YaHei", "Helvetica Neue", "Helvetica, Arial", sans-serif;
}

:-moz-placeholder {
  /* Mozilla Firefox 4 to 18 */
  color: #cbcbcb;
  font-family: PingFang-SC-Medium, "Microsoft YaHei", "Helvetica Neue", "Helvetica, Arial", sans-serif;
}

::-moz-placeholder {
  /* Mozilla Firefox 19+ */
  color: #cbcbcb;
  font-family: PingFang-SC-Medium, "Microsoft YaHei", "Helvetica Neue", "Helvetica, Arial", sans-serif;
}


:-ms-input-placeholder {
  /* Internet Explorer 10-11 */
  color: #cbcbcb;
  font-family: PingFang-SC-Medium, "Microsoft YaHei", "Helvetica Neue", "Helvetica, Arial", sans-serif;
}

.bgCom {
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  background-color: #fff;
}

.font1-ellipsis {
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bg-primary {
  background-color: $primaryColor !important;
}

.bg-success {
  background-color: $successColor !important;
}

.bg-info {
  background-color: $infoColor !important;
}

.bg-warning {
  background-color: $warningColor !important;
}

.bg-danger {
  background-color: $dangerColor !important;
}

.bg-calcel {
  background-color: $calcelColor !important;
}

.fl {
  float: left;
}

.fr {
  float: right;
}

.is-require:before {
  content: "*";
  color: $dangerColor;
  margin-right: .06rem;
}

.clearfix:after {
  display: block;
  content: '';
  height: 0;
  line-height: 0;
  clear: both;
  visibility: hidden;
}

.disInline {
  display: inline-block;
}

.show-inline {
  display: inline-block !important;
}

.show {
  display: block !important;
}

.hide {
  display: none !important;
}

.wrap {
  width: 96%;
  margin: 0 auto;
}

.flex {
  display: flex !important;
  justify-content: center;
  align-items: center;
}

.flex.flex-start {
  justify-content: flex-start !important;
}

.flex.flex-end {
  justify-content: flex-end !important;
}

.bold {
  font-weight: bold;
}

.bg-white {
  background: #FFFFFF !important;
}

.scroll-list {
  touch-action: none;
}

.primary-font-color {
  color: $primaryColor !important;
}

.success-font-color {
  color: $successColor !important;
}

.info-font-color {
  color: $infoColor !important;
}

.warning-font-color {
  color: $warningColor !important;
}

.danger-font-color {
  color: $dangerColor !important;
}

.calcel-font-color {
  color: $calcelColor !important;
}

.silver-font-color {
  color: #a2a2a2 !important;
}

// fs font-size @for 常用文字大小设置
@for $i from 0 through 10 {
  $distance: (0.02*$i);
  $fs: $distance+0.2;
  $name: $fs*100;

  .fs#{$name} {
    font-size:#{$fs}rem !important;
  }
}

// mg-t margin-top @for
@for $i from 0 through 5 {
  $distance: (0.1*$i);

  .mg-t#{$i} {
    margin-top:#{$distance}rem !important;
  }
}

// mg-b margin-bottom @for
@for $i from 0 through 5 {
  $distance: (0.1*$i);

  .mg-b#{$i} {
    margin-bottom:#{$distance}rem !important;
  }
}

// mg-l margin-left @for
@for $i from 0 through 5 {
  $distance: (0.1*$i);

  .mg-l#{$i} {
    margin-left:#{$distance}rem !important;
  }
}

// mg-r margin-right @for
@for $i from 0 through 5 {
  $distance: (0.1*$i);

  .mg-r#{$i} {
    margin-right:#{$distance}rem !important;
  }
}


// pd-t padding-top @for
@for $i from 0 through 5 {
  $distance: (0.1*$i);

  .pd-t#{$i} {
    padding-top:#{$distance}rem !important;
  }
}

// pd-b padding-bottom @for
@for $i from 0 through 5 {
  $distance: (0.1*$i);

  .pd-b#{$i} {
    padding-bottom:#{$distance}rem !important;
  }
}

// pd-l padding-left @for
@for $i from 0 through 5 {
  $distance: (0.1*$i);

  .pd-l#{$i} {
    padding-left:#{$distance}rem !important;
  }
}

// pd-r padding-right @for
@for $i from 0 through 5 {
  $distance: (0.1*$i);

  .pd-r#{$i} {
    padding-right:#{$distance}rem !important;
  }
}

.icon {
  display: inline-block;
  width: 0.37rem;
  height: 0.37rem;
  vertical-align: middle;
  text-align: center;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
}

.no-icon {
  background-image: none !important;
}

//不换行，溢出部分变为省略号
.no-wrap {
  word-break: keep-all;
  /* 不换行 */
  white-space: nowrap;
  /* 不换行 */
  overflow: hidden;
  /* 内容超出宽度时隐藏超出部分的内容 */
  text-overflow: ellipsis;
  width: 4.4rem;
  /*设置宽度*/
}

.border-top {
  border-top: 1px solid $borderColor;
}

.border-bottom {
  border-bottom: 1px solid $borderColor;
}

.border-left {
  border-left: 1px solid $borderColor;
}

.border-right {
  border-right: 1px solid $borderColor;
}

.line-space {
  width: 100%;
  height: .2rem;
  background: $bgColor;
}


/* table-flex */
.table-head {
  border-bottom: 1px solid #eee;

  .table-item {
    font-weight: bold;
  }
}

.table-flex {
  position: relative;
  z-index: 2;
  display: flex;
  text-align: center;
  justify-content: space-between;
  align-items: center;

  .table-item {
    width: 50%;
    height: .74rem;
    padding: .074rem 0;
    line-height: .74rem;
    background: #fff;
  }

  .table-line {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}

.table-wrap {
  width: 100vw;
  overflow: hidden;
  overflow-x: auto;

  .table-cls {
    table-layout: fixed;
    width: 100%;

    td {
      height: .8rem;
      line-height: .8rem;
      text-align: center;
      font-size: .24rem;
    }

    thead {

      // border-color:
      td {
        font-weight: bold;
      }
    }

    .td1 {
      width: 1.3rem;
    }

    .td2 {
      width: 1.5rem;
    }

    .td3 {
      width: 1.7rem;
    }

    .td4 {
      width: 1.8rem;
    }

    .td5 {
      width: 2.6rem;
    }
  }

}


/* tab */
$lineTabH: .88rem;

.line-tab {
  position: relative;
  z-index: 30;
  display: inline-block;
  margin: 0 auto;
  width: 100%;
  height: $lineTabH;
  overflow: hidden;
  overflow-x: auto;

  // display: flex;
  // width: 100%;
  text-align: center;
  // justify-content: center;
  // align-items: center;
  background: #fff;
  border-bottom: 1px solid #eaeaea;

  .tab-item {
    width: 100%;
    height: $lineTabH;
    line-height: $lineTabH;
    text-align: center;
    box-sizing: border-box;
    border-bottom: .01rem solid #fff;

    &:last-child {
      border-right-width: 0;
    }

    &.active {
      color: $mainColor;
      border-bottom-color: $mainColor;
    }

    &.no-border {
      border-right-width: 0;
    }
  }

  .tab-wrap {
    position: relative;
    text-align: left;
  }

  .tab-item {
    display: inline;
    color: #999999;
    font-size: .28rem;
    font-weight: bold;
    padding-bottom: .2rem;
    margin: 0 .2rem;
    min-width: 1rem;

    span {
      display: inline-block;
      line-height: .88rem;
    }
  }
}



// test 测试用
.dialog-test-box {
  $testBoxWH: 1rem;
  // position: relative;
  position: fixed;
  right: 0;
  bottom: .2rem;
  z-index: 39;
  width: $testBoxWH;
  height: $testBoxWH;
  line-height: $testBoxWH;
  text-align: center;
  font-size: .3rem;
  color: #fff;
  border-radius: 50%;
  background: $mainColor;
  box-shadow: 2px 4px 20px 1px #757575;
  // transform: translate(311px,506px);
}


.test-index-box {
  // margin-top: 2rem;
  padding-left: .5rem;
  list-style: decimal;
  // border-top: .2rem solid $borderColor;
  justify-content: flex-start;
  flex-wrap: wrap;
  background-color: #fff;

  // &:before {
  //   display: block;
  //   height: .8rem;
  //   line-height: .8rem;
  //   content: '-----------------------  测试使用  -----------------------';
  //   font-size: .3rem;
  //   text-align: center;
  //   color: #f00;
  // }

  li {
    // display: block;
    width: 96%;

    a {
      display: inline-block;
      margin: .1rem;
      padding: .1rem;
      font-size: .3rem;
      border: .01rem solid #dcdada;
      border-radius: .04rem;
    }
  }

  li.active {
    a {
      color: #fff;
      background-color: $successColor;
    }
  }
}

/* 加减数字 组件 */
.number-box {
  $numberBoxH: 0.6rem;
  width: 3rem;
  height: $numberBoxH;
  overflow: hidden;
  vertical-align: middle;
  line-height: $numberBoxH;
  border-radius: .13rem;
  box-sizing: border-box;

  .reduce,
  .plus {
    width: 20%;
    color: #fff;
    font-size: .3rem;
    cursor: not-allowed;
    background-color: #ddd;

  }

  .reduce,
  .plus,
  .num-input {
    display: inline-block;
    position: static;
    padding: 0;
    margin: 0;
    height: $numberBoxH;
    line-height: $numberBoxH;
    vertical-align: middle;
    text-align: center;
    background-image: none;
  }

  .num-input {
    width: 54%;
    font-size: .3rem;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
  }

  .reduce.active,
  .plus.active {
    cursor: auto;
    background-color: $mainColor;
  }


}